import type { RouteRecordRaw } from 'vue-router';

export const routes: RouteRecordRaw[] = [
  {
    path: '/',
    name: 'layout',
    component: () => import('@/layout/Layout.vue'),
    meta: {
      title: ''
    },
    redirect: '/home',
    children: [
      {
        path: '/home',
        name: 'home',
        meta: {
          title: '首页',
          icon: 'House',
          hidden: false
        },
        component: () => import('@/views/Home/index.vue'),
      }
    ],
  },
  {
    path: '/screen',
    name: 'screen',
    meta: {
      title: '数据大屏',
      icon: 'Monitor'
    },
    component: () => import('@/views/Screen/index.vue'),
  },
  {
    path: '/rightMgmt',
    component: () => import('@/layout/Layout.vue'),
    name: 'rightMgmt',
    meta: {
      title: '权限管理',
      icon: 'SetUp'
    },
    redirect: '/rightMgmt/user',
    children: [{
      path: '/rightMgmt/user',
      name: 'user',
      meta: {
        title: '用户管理',
        icon: 'Avatar'
      },
      component: () => import('@/views/RightMgmt/User/index.vue')
    }, {
      path: '/rightMgmt/role',
      name: 'role',
      meta: {
        title: '角色管理',
        icon: 'User'
      },
      component: () => import('@/views/RightMgmt/Role/index.vue')
    }, {
      path: '/rightMgmt/menu',
      name: 'menu',
      meta: {
        title: '菜单管理',
        icon: 'Memo'
      },
      component: () => import('@/views/RightMgmt/Menu/index.vue')
    }],
  },
  {
    path: '/products',
    meta: {
      title: '商品管理',
      icon: 'Grape'
    },
    component: () => import('@/layout/Layout.vue'),
    redirect: '/products/brand',
    children: [{
      path: '/products/brand',
      name: 'brand',
      meta: {
        title: '品牌管理',
        icon: 'Box'
      },
      component: () => import('@/views/Products/Brand/index.vue')
    }, {
      path: '/products/stats',
      meta: {
        title: '属性管理',
        icon: 'Key'
      },
      name: 'stats',
      component: () => import('@/views/Products/Stats/index.vue')
    }, {
      path: '/products/spu',
      meta: {
        title: 'SPU管理',
        icon: 'Ship'
      },
      name: 'spu',
      component: () => import('@/views/Products/Spu/index.vue')
    }, {
      path: '/products/spk',
      meta: {
        title: 'SPK管理',
        icon: 'Sunset'
      },
      name: 'spk',
      component: () => import('@/views/Products/Spk/index.vue')
    }],
  },
  {
    path: '/login',
    name: 'login',
    meta: {
      title: '登录',
      hidden: true
    },
    component: () => import('@/views/Login/index.vue'),
  },
  {
    path: '/404',
    name: '404',
    meta: {
      title: '404',
      hidden: true
    },
    component: () => import('@/views/404/index.vue'),
  },
  {
    path: '/:pathMatch(.*)*',
    redirect: '/404',
    meta: {
      hidden: true
    }
  },
]